//
//  NewTwoTableViewCell.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/17.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "NewTwoTableViewCell.h"

@implementation NewTwoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.contentView).offset(10);
        make.right.equalTo(self.contentView).offset(-10);
        make.height.equalTo(@(15 * SIZE));
        
    }];
    
    [self.imageL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.labelTitle);
        make.top.equalTo(self.labelTitle.mas_bottom).offset(10);
        make.width.equalTo(@((375 * KPropotionWidth - 10 * 4) / 3.0));
        make.bottom.equalTo(self.contentView).offset(-10);
        
        
    }];
    
    [self.imageC mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.imageL.mas_right).offset(10);
        make.top.width.bottom.equalTo(self.imageL);
    }];
    

    [self.imageR mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.imageC.mas_right).offset(10);
        make.top.width.bottom.equalTo(self.imageL);
    }];

    
}


- (void)createSubView
{
    self.backgroundColor = [UIColor whiteColor];
    
    
    // 标题
    self.labelTitle = [[UILabel alloc] init];
    self.labelTitle.font = [UIFont systemFontOfSize:16 * SIZE];
    self.labelTitle.text = @"网易新闻新闻新闻新闻新闻新闻新闻";
    [self.contentView addSubview:self.labelTitle];
    
    
    
    
    
    // 左侧图片
    self.imageL = [[UIImageView alloc]init];
    self.imageL.image = [UIImage imageNamed:@"lol-tupian"];
    [self.contentView addSubview:self.imageL];
    
    
    
    
    // 中间图片
    self.imageC = [[UIImageView alloc] init];
    self.imageC.image = [UIImage imageNamed:@"lol-tupian"];
    [self.contentView addSubview:self.imageC];
    

    
    
    // 右侧图片
    self.imageR = [[UIImageView alloc] init];
    self.imageR.image = [UIImage imageNamed:@"lol-tupian"];
    [self.contentView addSubview:self.imageR];
    
    
    
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
